﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoginForm
{
    class Validation
    {
        public static bool IsValidTextBox(string[] strArr) {
            foreach (string s in strArr)
            {
                if (s.Trim().Length == 0) {
                    return false;
                }
            }
            return true;
        }
        public static bool IsEmpty(String text) {
            if (text.Trim().Length == 0) {
                return true;
            }
            return false;
        }
        public static int? IsInt(String text) { 
            int i = 0;
            if (int.TryParse(text, out i))
            {
                return Convert.ToInt32(text);
            }
            return null;
        }
        public static float? IsFloat(string text) {
            float f = 0;
            if (float.TryParse(text, out f)) {
                return Convert.ToInt64(text);
            }
            return null;
        }
    }
}
